﻿/*
 * ========================================================================
 * Copyright(c) 2008-2010北京高阳金信信息技术有限公司, All Rights Reserved.
 * ========================================================================
 *  基金行情详细页面
 * 
 * 作者：马德强     时间：2010-06-22
 * 版本：V1.0
 * 
 * 修改者：         时间：          
 * 修改说明：
 * ========================================================================
*/
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
using am.Charts;
using System.ServiceModel;
using NBFModel;
using System.Collections.Generic;
using Hisuntech.SystemFramework.Net.Json;

public partial class FundDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string str = Request["jjdm"];
        string url = "http://localhost:9162/FundMarketService.svc/GetFundDetailsInfo?jjdm="+str+"";
        var list1 = JSONClient.GetData<List<NBFModel.FundDetailsInfo>>(url);

        #region - 包起原测试代码 -
        //自己添加一个数据
        //DataSet ds = new DataSet("Line");
        //DataTable dt = new DataTable("LineTable");
        //DataColumn dc_y = new DataColumn("year");
        //DataColumn dc_v = new DataColumn("val");

        //DataColumn dc_v1 = new DataColumn("val1");

        //dt.Columns.Add(dc_y);
        //dt.Columns.Add(dc_v);
        //dt.Columns.Add(dc_v1);
        //Random rd = new Random();
        //for (int i = 1987; i < 2010; i++)
        //{
        //    DataRow dr = dt.NewRow();
        //    dr[dc_y] = i.ToString();
        //    dr[dc_v] = (rd.NextDouble() * i).ToString();
        //    dr[dc_v1] = (rd.NextDouble() * (i + i / 3)).ToString();
        //    dt.Rows.Add(dr);
        //}
        //ds.Tables.Add(dt); 
        #endregion

        //设置图形的长高
        LineChart1.Width = new Unit(875);
        LineChart1.Height = new Unit(400);

        //添加一个线条
        LineChartGraph lcg = new LineChartGraph();
        //这里是线条峰点的形状(正方形):实心圆,空心圆....
        //lcg.Bullet = LineChartBulletTypes.SquareOutline;
        //这里是线条的颜色
        //lcg.BulletColor = Color.Yellow;
        //向下面积的颜色
        //lcg.FillColor = Color.Yellow;
        ////向下面积的透明度
        //lcg.FillAlpha = Convert.ToByte(40);
        ////Y轴值在右边(默认在左边)
        //lcg.Axis = LineChartAxes.Right;

        lcg.DataSource = list1;
        lcg.DataSeriesItemIDField = "发生日期";
        lcg.DataValueField = "单位净值";
        lcg.Title = "单位净值";
        LineChart1.Graphs.Add(lcg);

        //添加第二个线条
        LineChartGraph lcg1 = new LineChartGraph();
        //lcg1.Bullet = LineChartBulletTypes.RoundOutline;

        lcg1.DataSource = list1;
        lcg1.DataSeriesItemIDField = "发生日期";
        lcg1.DataValueField = "累计净值";
        lcg1.Title = "累计净值";
        LineChart1.Graphs.Add(lcg1);

        LineChart1.DataSource = list1;
        LineChart1.DataSeriesIDField = "发生日期";
        LineChart1.DataBind();
    }
}
